<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        $bbsdata=M('think_data');
        $data=$bbsdata->order('id desc')->select();
        $bbscount=$bbsdata->count();
        $this->assign('bbscount',$bbscount);
        $this->assign('rows',$data);
        $this->display();
        
    }
    public function del()
     {
        $id=I('get.id',0);
        $bbsdata=M("think_data");
        $rs=$bbsdata->delete($id);
        if($rs)
        {
           $this->success('删除成功',U('Home/Index/index'));
        }
        else 
        {
            $this->error('删除失败');
        }
    }
    public function edit()
    {
        $this->shou('修改');
    }
}